<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class T_WMS_STOCK_ITEM extends Model
{
    public $table='T_WMS_STOCK_ITEM';
    public $connection='mysql';
    public function index($ITEM_CODE){
        $CONNECT_DOC=$this->alias('a')
            ->leftJoin('T_WMS_STOCK_DOC b','a.DOC_NO=b.DOC_NO')
            ->whereIn('a.ITEM_CODE',$ITEM_CODE)
            ->where('b.DOC_TYPE','=','DJ12')
            ->where('a.DOC_NO','<>','')
            ->value('a.DOC_NO');
        return $CONNECT_DOC;
    }
}
